<% content_for :googlemaps do %>
  <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
  <script type="text/javascript">
    var stockholm = new google.maps.LatLng(10.463536424076864, -66.97718103149418);
    var parliament = new google.maps.LatLng(10.463536424076864, -66.97718103149418);
    var marker;
    var map;
    var point;

    function initialize() {
      var mapOptions = {
        zoom: 14,
        mapTypeId: google.maps.MapTypeId.ROADMAP,
        center: stockholm
      };

      map = new google.maps.Map(document.getElementById("map_canvas"),
      mapOptions);

      marker = new google.maps.Marker({
        map:map,
        draggable:true,
        animation: google.maps.Animation.DROP,
        icon: "/images/machine32.png",
        position: parliament
      });
      google.maps.event.addListener(marker, 'click', toggleBounce);
      google.maps.event.addListener(marker, 'dragend', coordinates);
    }

    function toggleBounce() {
      if (marker.getAnimation() != null) {
        marker.setAnimation(null);
      } else {
        marker.setAnimation(google.maps.Animation.BOUNCE);
      }
    }

    function coordinates() {
      var point = new google.maps.LatLng(marker.getPosition().lat(),marker.getPosition().lng(),true);
      map.panTo(point);
      document.getElementById("machine_latitude").value = point.lat();
      document.getElementById("machine_longitude").value = point.lng();
    }

  </script>
<% end %>


<h2 align="center" class="ourCompany-hdr"><%= t('machine.new') %></h2>

  <% form_for(@machine) do |f| %>
  <%= f.error_messages %>
  <table width="200" align="left" border="0" cellspacing="4" cellpadding="4">
	      <tr>
                <td>&nbsp;</td>
                <td nowrap="nowrap" align="left"><%= f.label(:status, t('machine.status')) %></td>
                <td><%= f.select :status, ['Enable','Disable'] %></td>
        </tr>
	      <tr>
	        <td>&nbsp;</td>
	         <td nowrap="nowrap" align="left"><%= f.label(:state, t('machine.state')) %></td>
      <td><%= f.select :state, ['Amazonas','Anzoátegui',
                                'Apure','Aragua','Barinas',
                                 'Bolivar','Carabobo','Cojedes',
                                 'Delta Amacuro', 'Distrito Capital',
                                 'Falcon', 'Guarico', 'Lara', 'Merida',
                                  'Miranda', 'Monagas', 'Nueva Esparta',
                                  'Portuguesa', 'Sucre','Tachira','Trujillo',
                                   'Vargas','Yaracuy', 'Zulia'] %></td>
        </tr>
	      <tr>
	        <td>&nbsp;</td>
	         <td nowrap="nowrap" align="left"><%= f.label(:zone, t('machine.zone')) %></td>
      <td><%= f.text_field :zone %></td>
        </tr>
	      <tr>
	        <td>&nbsp;</td>
	        <td nowrap="nowrap" align="left"><%= f.label(:model, t('machine.model')) %></td>
       <td><%= f.select :model, ['GxE5000','GxE9000'] %></td>
        </tr>
	      <tr>
	        <td>&nbsp;</td>
	        <td nowrap="nowrap" align="left"><%= f.label(:brand, t('machine.brand')) %></td>
      <td><%= f.select :brand, ['Titanum 2000','Gold 3990'] %></td>
        </tr>
	      <tr>
	        <td>&nbsp;</td>
	        <td nowrap="nowrap" align="left"><%= f.label(:version, t('machine.version')) %></td>
      <td><%= f.select :version, ['Ultimate','Premium'] %></td>
        </tr>
	      <tr>
	        <td>&nbsp;</td>
	       <td nowrap="nowrap" align="left"><%= f.label(:os, t('machine.os')) %></td>
      <td><%= f.select :os, ['Linux','Windows'] %></td>

        </tr>
	      <tr>
	        <td>&nbsp;</td>
	       <td nowrap="nowrap" align="left"><%= f.label(:disc, t('machine.disc')) %></td>
      <td><%= f.select :disc, ['10','20'] %>GB</td>

        </tr>
	      <tr>
	        <td>&nbsp;</td>
	         <td nowrap="nowrap" align="left"><%= f.label(:ram, t('machine.memory')) %></td>
     <td><%= f.select :ram, ['2','4'] %>GB</td>

        </tr>
	      <tr>
	        <td>&nbsp;</td>
	        <td nowrap="nowrap" align="left"><%= f.label(:processor, t('machine.procesor')) %></td>
      <td><%= f.select :processor, ['Intel','Amd'] %></td>

        </tr>
	      <tr>
	        <td>&nbsp;</td>
	        <td nowrap="nowrap" align="left"><%= f.label(:cant_ap, t('machine.max')) %></td>
      <td><%= f.text_field :cant_ap %></td>
        </tr>
        <td><%= f.hidden_field :administrator_id,:value=>session[:id] %></td>
  </table>
<table align="center">

  <tr align="center">
    <td>&nbsp;</td>
    <td>&nbsp;</td>
          <%= f.hidden_field(:longitude) %><%= f.hidden_field(:latitude)%>
    <td align="center"> <div  id="map_canvas" style="width:400px; height:210px"> </div><%= f.label("Location")%><br/><%= t('machine.info') %></td>
    <td><%= link_to image_tag("/images/back.png", :title =>  t('machine.back'), :border=>0), machines_path %></td>
    <td><%= image_submit_tag("/images/add_cate.png", :title =>  t('machine.create'), :border=>0) %></td>

        </tr>
     
      </table>


    <% end %>
   

